#pragma warning(disable:4996)
#include<stdio.h>
int main()
{
	int x, sum, i;
	sum = 0;
	scanf("%d", &x);
	for ( i = 1; i <= x; i++) {
		if (!(x % i))
			sum += i;
	}
	printf("%d", sum);
	return 0;
}
